#include<stdio.h>
#include<stdlib.h>
#include"str_to_int.h"


extern int day,year,month,d;
void str_to_int(const char **date)
{
	
	int i = 0;//i,d用来做遍历传参用
	d = -1;
	while(date[1][i])
	{
		if((date[1][i] == '/' || date[1][i] == '.') && d == -1)
		{
			d = 0;
			i++;
			continue;//此时到了月份的字符串中去
		}
		if((date[1][i] == '/' || date[1][i] == '.') && d == 0)
		{
			d = 1;
			i++;
			continue;//此时到了day的字符串中去
		}
		if(d == -1)
		{
			year = year*10 + date[1][i] - '0';
		}
		if(d == 0)
		{
			month = month*10 + date[1][i] - '0';
		}
		if(d == 1)
		{
			day = day*10 + date[1][i] - '0';
		}
		i++;
	}
}